<!-- 
#   JEE6 page 118
-->

<html>
<head>
<title>Test page 118</title>
</head>
<body>

<%
String login = "";
String password = "";
String infos = null;
Cookie[] gatos;
// recup cookies
gatos = request.getCookies();
// verif si cookies
if (gatos != null) {
  for (int i=0 ; i<gatos.length ; i++) {
    if (gatos[i].getName().equals("login")) {
      infos = gatos[i].getValue();
      login = infos.split("-")[0];
      password = infos.split("-")[1];
    }
  }
}
%>
<h1>Merci de vous identifier</h1>

<form method="post" action="Authentification">
  <table>
    <tr>
      <td>nom</td>
      <td><input type="text" name="login" value="<%=login%>" /></td>
    </tr>
    <tr>
      <td>prenom</td>
      <td><input type="password" name="password" value="<%=password%>" /></td>
    </tr>
    <tr>
      <td></td>
      <td><input type="checkbox" name="memo" value="memo" /><label> enregistrer vos infos de connexion</label></td>
    </tr>
    <tr>
      <td></td>
      <td><input type="submit" value="Valider" /></td>
    </tr>
  </table>
  
  <%
  String message;
  message = (String) request.getAttribute("message");
  if (message != null) {
    out.println(message);
  }
  %>
  
</form>


</body>
</html>

